<!--
 * @Author: your name
 * @Date: 2022-01-15 14:47:41
 * @LastEditTime: 2022-01-16 09:22:04
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \my-site\src\components\toTop\index.vue
-->
<template>
  <div class="toTop-container" @click="toTop">顶部</div>
</template>

<script>
import eventBus from "../../utils/eventBus" //事件总线
export default {
    methods:{
        toTop(){
            eventBus.$emit("toTop")
        }
    }
}
</script>

<style scoped lang="less">
.toTop-container{
    position:absolute;
    bottom:50px;
    right:50px;
    padding:20px;
    border-radius:50%;
    color:#fff;
    cursor:pointer;
    background-color:rgb(28, 28, 179);
    z-index:999
}
</style>